﻿<UserControl x:Class="Gao.Poker.App.Store.SellHistoryView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:UserControls="clr-namespace:Gao.Poker.App.UserControls" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="4*"/>
            <ColumnDefinition Width="6*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="30"/>
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="1">
                <TextBlock Text="姓名：" Margin="10,5,0,5" FontSize="14" VerticalAlignment="Center" />
                <TextBox Text="{Binding Path=MemberName}" Width="100" Margin="0,5,0,5" FontSize="14" />
                <TextBlock Text="会员卡号：" Margin="5,5,0,5" FontSize="14" Width="67" VerticalAlignment="Center" />
                <TextBox Text="{Binding Path=MemberCardNo}" Margin="0,5,0,5" Width="100" FontSize="14" />
                <Button x:Name="btnSearch" Margin="10,1,1,1" Width="55" Style="{DynamicResource Orrange}" Content="查询" RenderTransformOrigin="0.491,0.394" Height="25" FontSize="14" />
            </StackPanel>
            <DataGrid Grid.Row="1" Margin="1" RowHeight="30" AutoGenerateColumns="False" 
                      SelectionMode="Single"  CanUserAddRows="True" ItemsSource="{Binding Path=Consumptions}"  
                      SelectedItem="{Binding Path=Consumption}" AlternationCount="2"
                      FontSize="16" Height="Auto" IsReadOnly="True">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="会员号" Width="120" IsReadOnly="True" Binding="{Binding Path=MemberCardNo}"/>
                    <DataGridTextColumn Header="姓名" Width="*" IsReadOnly="True" Binding="{Binding Path=MemberName}"/>
                    <DataGridTextColumn Header="金额" Width="60" IsReadOnly="True" Binding="{Binding Path=Monetary}"/>
                </DataGrid.Columns>
            </DataGrid>
            <UserControls:Pager Grid.Row="2" Count="{Binding Path=ConsumptionTotal}" PageIndexChanging="Pager_PageIndexChanging" />
        </Grid>
        

        <DataGrid  Grid.Row="1" Grid.Column="1"  Margin="1" RowHeight="30" AutoGenerateColumns="False" 
                      SelectionMode="Single"  CanUserAddRows="True"
                   ItemsSource="{Binding Path=Consumption.ConsumptionPrlducts}" 
                      FontSize="16" Height="Auto" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="编码" Width="60" Binding="{Binding Path=BarCode}"/>
                <DataGridTextColumn Header="商品名称" Width="*" Binding="{Binding Path=ProductName}"/>
                <DataGridTextColumn Header="单价" Width="60" Binding="{Binding Path=Price}"/>
                <DataGridTextColumn Header="购买数量" Width="80" Binding="{Binding Path=Number}"/>
                <DataGridTextColumn Header="折扣" Width="80" Binding="{Binding Path=Discount}"/>
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
